﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace Mrb.Utils
{
    public static class EnumerableExtensions
    {
        public static void ForEach<T>(this IEnumerable<T> list, Action<T> action)
        {
            foreach (var t in list)
            {
                action(t);
            }
        }

        public static IEnumerable<O> Map<I,O>(this IEnumerable<I> list, Func<I, O> f)
        {
            return list.Select(f).ToList();
        }
    }
}